package v3.main;

import java.io.IOException;

import v3.object.STcfg;
import v3.object.ship.Ship;
import v3.object.space.Universe;



public class StarTrek
{

	private STcfg cfg;

	public StarTrek(STcfg cfg)
	{
		this.cfg=cfg;
	}

	public static void main(String[] args) throws IOException
	{
		STcfg cfg = new STcfg();
		cfg.setUp(args);
		StarTrek s = new StarTrek(cfg);
		s.process();
	}

	private void process() throws IOException
	{

		Engine engine = null;
		Ship ship = null;		

		Universe universe = new Universe(cfg);		
		try
		{
			universe.generate();
			ship = new Ship(universe, cfg);		
			engine = new Engine(ship,universe,cfg);
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}		
		
		engine.engage();			
    
	}
}
